package file;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class Test10 {
    public static void main(String[] args) {
        try (InputStream inputStream = new FileInputStream("test/test.txt")) {
            int len;
            byte[] buffer = new byte[1024];
            while (true) {
                len = inputStream.read(buffer);
                if (len == -1) {
                    break;
                }
                String s = new String(buffer, 0, len, "utf-8");
                System.out.println(s);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
